package chainOfComand;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

public class CommandChain {

	private List<ICommand> comandos = new ArrayList<ICommand>();
	
	public void addCommand(ICommand comando) {
		this.comandos.add(comando);
	}
	
	public void runCommand(String comando, Map<String, String> parametros) {
		for (ICommand command: comandos) {
			if (command.onCommand(comando, parametros))
				return;
		}
	}
}
